﻿using Microsoft.Xna.Framework.Input;
using RaptorEngine.Managers;
using RaptorEngine;

namespace OilRigSumoWrestlers.Commands
{
    class UseCommand : InputCommand
    {
        public Keys? Key { get; set; }
        public Buttons? Button { get; set; }
        public Buttons? ExtraButton { get; set; }
        public LogicalPlayerIndex LogicalPlayer { get; set; }

        protected override bool OnDetect()
        {
            return
                (Key.HasValue && GameEngine.Instance.Input.IsPressed(Key.Value))
                || (Button.HasValue && GameEngine.Instance.Input.IsPressed(Button.Value, LogicalPlayer))
                || (ExtraButton.HasValue && GameEngine.Instance.Input.IsPressed(ExtraButton.Value, LogicalPlayer));
        }
    }
}
